package com.stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

public class CreateStream {
    public static void main(String[] args) {

//        创建流的几种方式
        // 1.独立的值
        Stream stream = Stream.of("a", "b", "c");
        // 2. 通过数组
        String [] strArray = new String[] {"a", "b", "c"};
        stream = Stream.of(strArray);
        stream = Arrays.stream(strArray);
        // 3. 通过集合
        List<String> list = Arrays.asList(strArray);
        stream = list.stream();
    }
}
